package com.example.bootdemo.rabbitmq;


import com.example.bootdemo.configuration.RabbitMqConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues = {RabbitMqConfiguration.DIRECT_QUEUE_NAME})
public class DirectMessageConsumer {

    private static Logger logger = LoggerFactory.getLogger(DirectMessageConsumer.class);
    @RabbitHandler
    public void consumeMessage(String message){

        logger.info("接受到直接式消息："+message);

    }

}
